package cn.kgc.jdktest.demo10;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @Author:yaozhaobao
 * @Description:TODO
 * @version:1.0
 */
public class Test5 {
    public static void main(String[] args) {
        Stream<String> stream = Stream.of("马云", "赵丽颖", "马丽", "马赛克", "迪丽热巴",
                "马华腾", "发条魔灵", "马德里不思议", "马克思", "马冬梅", "柳岩");


        // 将流中的元素, 从String类型, 转换成Person类型
       // stream.map(t -> new Person(t)).forEach(System.out::println);
        List<String> list = stream.filter(t -> t.startsWith("马")).collect(Collectors.toList());
        System.out.println(list);
    }
}


